class Base2 {
  greet() {
    console.log('hello world');
  }
}

class Derived2 extends Base2 {
  greet(name?: string){
    if (name === undefined) {
      super.greet()
    } else{
      console.log(name.toUpperCase());
    }
  }
}

/* class Derived2 extends Base2 {
  greet(name: string){
      console.log(name.toUpperCase());
  }
} */

const d2 = new Derived2()
d2.greet()
d2.greet('reader')

const b:Base2 = d2
b.greet()

